package com.awardsystem.Dao;



import com.awardsystem.entity.User;


import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;


public interface UserDao extends JpaRepository<User,Integer> {
    User findByNumber(String number);
    User findByPersonNameAndCorp(String personName,String corp);
    User findUserById(Integer id);
    List<User> findByPersonNameContains(String name);
    User findUserByPersonName(String name);
//    @Select("select * from user where id=#{id}")
//    public User FindOneUser(int id);
//
//    @Select("select count(id) from user where number=#{number}")
//    public int RepeatAdd(User newuser);
//
//
//    @Insert("insert into user(personName, number, addDate, profile) values(#{personName}," +
//            "#{number},"+"#{addDate},"+"#{profile})")
//    public int AddNewUser(User newuser);
//
//    @Select(value="select * from user  order by binary ${colum} ${ShowOrder}")
//    public List<User> FindAllUsers(UserOrder order);
//
//    @Select("select * from user where personName like '%${colum}%'")
//    public List<User> FindUserByName(UserOrder user);
//
//    @Delete("delete from user where id=${colum}")
//    public int DelUserById(UserOrder user);
//
//
//    @Update("update user set number=#{number}, profile=#{profile}, personName=#{personName} where number=#{preNumber}")
//    public int UpdateUser(UpdateUser upUser);
//
//    @Select("select  personName from user where profile='教师'")
//    public List<String> GetAllTeachers();
//
//    @Insert("insert into projects(name,number,level,kind,leader,addDate) " + "values(#{name},#{number},#{level},#{kind},#{leader},#{addDate})")
//    public int AddProject( Project anewproject);
//
//    @Select("select * from projects")
//    public List<Project> GetAllProjects();
//
//    @Select("select count(*) from projects where number=#{number}")
//    public int FindProjectByNumber(String number);
//
//    @Delete("delete from projects where number=#{number}")
//    public int DeleteProjectByNumber(String number);
//
//    @Select("select * from projects where name like '%${word}%'")
//    public List<Project> findProjectBykeyword(String word);
//
//    @Update("update projects set name=#{name}, kind=#{kind}, level=#{level}, leader=#{leader} , number=#{number} where name=#{prename}")
//    public int updateOneProject(@RequestBody Project updateproject);
}
